﻿using Microsoft.EntityFrameworkCore;

namespace CanalService.Services
{
    /// <summary>
    /// 同步数据到MySQL
    /// </summary>
    public class CanalToMySqlHostService :  IHostedService
    {

        private readonly CanalToMySqlService _mySqlService;
        public CanalToMySqlHostService(CanalToMySqlService canalService)
        {
            _mySqlService = canalService;
        }


        public Task StartAsync(CancellationToken cancellationToken)
        {
            _mySqlService.OnStart();
            return Task.CompletedTask;

        }

        public Task StopAsync(CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
        }
    }
}
